import {defineStore} from "pinia";

export const useUserStore = defineStore('user',{
    state: () => ({
        token: null,
        username: null,
        role: null,
        status: null,
        profile: {
            id: null,
            name: null,
            telephone: null,
            mail: null,
            intro: null,
            consult_price: null,
        }
    }),
    persist: {
        enabled: true,
        strategies: [
            {
                key: 'GBook#user',
                storage: localStorage,
                paths: ['token', 'username']
            }
        ]
    }
})
